
<html>
  <head>
    <title>user_list.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<script type="text/javascript" src="/assets/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="/assets/js/util.js"></script>
	<script type="text/javascript">
		
		var temp=0;
		var href=getHref();
		var usersessionid=href.usersessionid;
		function activateOnline(){
			var lagTime=1000*30;
			var target='/activateOnline';
			$.ajax({
				type:'get',
				url:target,
				data:'usersessionid='+usersessionid+'&temp='+temp++,
				error:function(err){
					setTimeout(activateOnline, lagTime);
				},
				success:function(data){
					data=$.trim(data);
					if(data=='updateSuccess'){
						setTimeout(activateOnline, lagTime);
					}
					
				}
			});
		}
		function comnetPersonsInfo(){
			var target='/comnetPersonsInfo';
			$.ajax({
				type:'get',
				url:target,
				data:'usersessionid='+usersessionid+'&temp='+temp++,
				error:function(err){
					comnetPersonsInfo();
				},
				success:function(data){
					data=eval(data);
					var tbody_data='';
					$.each(data,function(i,user){
						tbody_data+='<tr title=\'双击聊天和'+user.username+'\' style=\'cursor: pointer;\'><td id=\''+user.usersessionid+'\' >&nbsp;&nbsp;'+user.username+'</td></tr>';
					});
					$('#users_tbody').html(tbody_data);
					comnetPersonsInfo();
				}
			});
		}
		$(function(){
			var laoding='<tr><td>正在加载聊天室人员</td></tr>';
			$('#users_tbody').html(laoding);
			comnetPersonsInfo();
			activateOnline();
		});
	</script>
  </head>
  
  <body style="margin-top: 0;margin-bottom: 0;margin-left: 0;margin-right: 0">
    <table id='users'>
    	<thead id='users_thead'>
    		<tr>
    			<td>在线人员</td>
    		</tr>
    	</thead>
    	<tbody id='users_tbody'></tbody>
    </table>
  </body>
  <p id=temp></p>
</html>
